

#ifndef ZGEOMENT_DBELIPSE_H
#define ZGEOMENT_DBELIPSE_H

#include "zgegbl.h"
#include "zdbmain.h"
#include "zdbcurve.h"

#pragma pack(push, 8)

class UcDbEllipse: public  UcDbCurve
{
public:
    UcDbEllipse();
    UcDbEllipse(const UcGePoint3d&  center,
	        const UcGeVector3d& unitNormal,
	        const UcGeVector3d& majorAxis,
	        double              radiusRatio,
	        double              startAngle = 0.0,
	        double              endAngle   = 6.28318530717958647692);
    virtual ~UcDbEllipse();
    UCDB_DECLARE_MEMBERS(UcDbEllipse);

    UcGePoint3d center() const;
    Ucad::ErrorStatus setCenter(const UcGePoint3d& center);

    UcGeVector3d normal() const;
    UcGeVector3d majorAxis() const;
    UcGeVector3d minorAxis() const;
	UCDB_PORT double majorRadius() const;
	UCDB_PORT Ucad::ErrorStatus setMajorRadius(double);
	UCDB_PORT double minorRadius() const;
	UCDB_PORT Ucad::ErrorStatus setMinorRadius(double);

    double radiusRatio() const;
    Ucad::ErrorStatus setRadiusRatio(double ratio);

    double startAngle() const;
    Ucad::ErrorStatus setStartAngle(double startAngle);    

    double endAngle() const;
    Ucad::ErrorStatus setEndAngle(double endAngle);

    Ucad::ErrorStatus setStartParam(double startParam);
    Ucad::ErrorStatus setEndParam(double endParam);

    double paramAtAngle(double angle) const;
    double angleAtParam(double param) const;

    Ucad::ErrorStatus get(UcGePoint3d& center, UcGeVector3d& unitNormal,
	UcGeVector3d& majorAxis, double& radiusRatio, double& startAngle,
	double& endAngle) const;
    Ucad::ErrorStatus set(const UcGePoint3d& center,
	const UcGeVector3d& unitNormal, const UcGeVector3d& majorAxis,
	double radiusRatio, double startAngle = 0.0,
	double endAngle = 6.28318530717958647692);

    ZSoft::Boolean isNull() const;
				   
    DBCURVE_METHODS

    virtual Ucad::ErrorStatus getGripPoints(UcGePoint3dArray&    gripPoints,
	    UcDbIntArray& osnapMasks, UcDbIntArray& geomIds) const;

    virtual  Ucad::ErrorStatus moveGripPointsAt(
	const UcDbIntArray& indices, const UcGeVector3d& offset);

    virtual  Ucad::ErrorStatus intersectWith(
	const UcDbEntity* ent, UcDb::Intersect intType,
        UcGePoint3dArray& points, ZSoft::GsMarker thisGsMarker = 0,
        ZSoft::GsMarker otherGsMarker = 0) const;

    virtual  Ucad::ErrorStatus intersectWith(
	const UcDbEntity* ent, UcDb::Intersect intType,
	const UcGePlane& projPlane, UcGePoint3dArray& points,
        ZSoft::GsMarker thisGsMarker = 0, ZSoft::GsMarker otherGsMarker = 0) const;

    virtual Ucad::ErrorStatus getTransformedCopy(
	const UcGeMatrix3d& xform, UcDbEntity*& ent) const;

    virtual Ucad::ErrorStatus getClassID(CLSID* pClsid) const;
    virtual void gripStatus(const UcDb::GripStat status);
    virtual Ucad::ErrorStatus   getGripPoints(UcDbGripDataPtrArray& grips,
        const double curViewUnitSize, const int gripSize,
        const UcGeVector3d& curViewDir, const int bitflags) const;

    virtual bool castShadows() const;
    virtual void setCastShadows(bool newVal);
    virtual bool receiveShadows() const;
    virtual void setReceiveShadows(bool newVal);
};

#pragma pack(pop)

#endif
